<template>
	<view class="wrap">
		<js-lang title="home.title" :showBtn="true"></js-lang>
		<u-swiper :height="350" :list="imgList" :title="false" @click="imgListClick"></u-swiper>
		
		<view class="u-p-t-10 u-p-b-20">
			<view class="u-m-t-20">
				<u-cell-group v-for="(menu, index) in menuList">
					
					<u-cell-item :icon="menu.menuIcon" iconSize="64" 
						:title="menu.menuName" @click="navTo(menu.url)">
					</u-cell-item>
				</u-cell-group>
			</view>
		</view>
		<view class="cu-bar bg-white solid-bottom">
			<view class="action">
				<u-icon name="/static/common/img/count3.png" size="80"></u-icon>
				<text class="text-lg text-blue">查询统计</text>
			</view>
		</view>
		<view class="u-p-t-10 u-p-b-20">
			<view class="u-m-t-20">
				<u-cell-group v-for="(menu, index) in menuList2">
					
					<u-cell-item :icon="menu.menuIcon" iconSize="64" 
						:title="menu.menuName" @click="navTo(menu.url)">
					</u-cell-item>
				</u-cell-group>
			</view>
		</view>
	</view>
</template>
<script>
/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
export default {
	data() {
		return {
			imgList: [
				// {image: '/static/jeesite/banner/1.svg'},
				// {image: '/static/jeesite/banner/2.svg'},
				// {image: '/static/jeesite/banner/3.svg'},
				{image: '/static/jeesite/banner/1.png'},
				{image: '/static/jeesite/banner/2.jpg'},
				{image: '/static/jeesite/banner/3.png'},
				{image: '/static/jeesite/banner/4.png'}
			],
			
			todoCount: 0,
			menuList: [
				{
					menuCode: 'a13',
					menuName: '今日现金收支',
					menuIcon: '/static/common/img/inMoney2.png',
					menuColor: '',
					url: '/pages/sys/mzyy/dayMoneyList',
				},
				{
					menuCode: 'a12',
					menuName: '现金收入汇总',
					menuIcon: '/static/common/img/payMoney2.png',
					menuColor: '',
					url: '/pages/sys/mzyy/dayInMoneyItemList',
				},
				{
					menuCode: 'a11',
					menuName: '现金支出汇总',
					menuIcon: '/static/common/img/report.png',
					menuColor: '',
					url: '/pages/sys/mzyy/dayPayMoneyItemList',
				}
			],
			menuList2: [
				{
					menuCode: 'a10',
					menuName: '月现金收入',
					menuIcon: '/static/common/img/monthIn.png',
					menuColor: '',
					url: '/pages/sys/mzyy/monthMoneyInList',
				},
				{
					menuCode: 'a09',
					menuName: '月现金支出',
					menuIcon: '/static/common/img/monthPay.png',
					menuColor: '',
					url: '/pages/sys/mzyy/monthMoneyPayList',
				},
				{
					menuCode: 'a08',
					menuName: '年现金收入',
					menuIcon: '/static/common/img/yearIn.png',
					menuColor: '',
					url: '/pages/sys/mzyy/yearMoneyInList',
				},
				{
					menuCode: 'a07',
					menuName: '年现金支出',
					menuIcon: '/static/common/img/yearPay.png',
					menuColor: '',
					url: '/pages/sys/mzyy/yearMoneyPayList',
				}
			],
				
		};
	},
	onLoad() {
		//this.refreshCount();
	},
	onShow() {
		//this.refreshCount();
	},
	methods: {
		navTo(url) {
			uni.navigateTo({
				url: url
			});
		},
		refreshCount() {
			// 获取待办个数
			this.$u.api.bpm.myTaskList({status:1,pageSize:1}).then(res => {
				this.todoCount = res.count || 0;
			});
		},
		imgListClick(index) {
			console.log(`点击了第${index + 1}页图片`)
		},
		itemClick(index) {
			console.log(index);
		}
	}
};
</script>
<style lang="scss">
@import 'index.scss';
page {
	background-color: #f8f8f8;
}
</style>
